﻿using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

/*********************************************************
 * 命名空间 App.Client
 * 接口名称 ClientManager
 * 开发人员：11920
 * 创建时间：2023/4/26 9:09:19
 * 描述说明：
 * 更改历史：
 * 
 * *******************************************************/
namespace App.Client
{
	public class ClientManager
	{
		public static ConcurrentDictionary<string,IClient> cliens=new ConcurrentDictionary<string, IClient>();

		static ClientManager()
		{
			cliens = new ConcurrentDictionary<string, IClient>();
		}

		public void AddClient(string SN,IClient client)
		{
			if (!cliens.ContainsKey(SN))
			{
				cliens.TryAdd(SN, client);
			}
		}

		public void RemoveClient(string SN) 
		{
			if (cliens.ContainsKey(SN))
			{
				cliens.TryRemove(SN,out IClient client);
			}
		}
	}
}
